home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / f2c / amiga / f2c.rea < prev   
Text File  |  1993-04-24  |  3KB  |  67 lines

  1. Short: A Fortran->C source code translator
  2. Type: dev/lang
  3. Uploader: egstern@fnpx01.fnal.gov
  4.  
  5. f2c - a Fortran to C converter
  6.  
  7.  
  8.  
  9. This f2c is ported from the July 1992 version taken from
  10. research.att.com and targeted for SAS/C 6.2.  All the original
  11. code is included.  My modifications are #ifdefed into the source.  The
  12. parser code was generated with GNU bison so I've included the GNU
  13. alloca.c. 
  14.  
  15. Using SAS/C versions before 6.2 will not work because of compiler
  16. bugs.  This release of f2c has not been extensively tested.  The f2c
  17. program is most likely to be correct.  The I/O library I77.lib is
  18. probably full of bugs.  Known AmigaDOS problems make it a problem to
  19. write to the NIL: device and probably also to pipes. 
  20.  
  21. The source is organized into three directories:
  22.  
  23.     f2c/src        contains the source and executable for the f2c
  24.                 program.  Also has the f2c.h include file.
  25.     f2c/F77lib    contains the source and library F77.lib.
  26.     f2c/I77lib    contains the source and library I77.lib.
  27.  
  28. I've included my smakefile for making f2c, I77.lib and F77.lib.  I
  29. have not make a version for 68881.  If you want to do this, I suggest
  30. you change include:math.h to include m68881.h at the end, then recompile
  31. everything with the math=68881 option.  There is a formatted man page
  32. for f2c in src/f2c.1.
  33.  
  34. To compile and link a fortran program you run f2c on the .f file to
  35. make a .c file.  Recommended options are -A for ansi C.  Slink
  36. cannot deal with multiply defined global variables, even with the
  37. 'common' option (this problem has been reported to SAS).  If you use
  38. common blocks you should also compile your program with -E.  This
  39. makes all the declarations of the common blocks listed as 'extern'.
  40. You should then put all your common blocks into a BLOCK DATA somewhere
  41. which you compile without -E.  Then the linker will be happy.
  42.  
  43. Then you compile the .c files with sc.  The libraries that I've
  44. supplied have been compiled with data=far and math=ieee, so you should
  45. compile your programs this way.  The generated C code makes use of the
  46. file f2c.h which can be found in the f2c/src directory.  The C code
  47. calls support routines from the libraries F77.lib and I77.lib so you
  48. should link with them and also with scnb.lib.  A suitable SCOPTIONS
  49. file might look:
  50.  
  51. DATA=FAR
  52. MATH=IEEE
  53. LINK
  54. NOICONS
  55. LIBRARY=lib:f77.lib
  56. LIBRARY=lib:i77.lib
  57.  
  58. There is an example smakefile for a large project in
  59. f2c/smakefile-example.
  60.  
  61. Good luck.  Feel free to fix any problems you find.  I'll try to
  62. coordinate any improvements that people make.
  63.  
  64.                 Eric Stern
  65.                 egstern@fnpx19.fnal.gov
  66.  
  67.